import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-11-09
 * Time: 19:43
 */
public class Demo1 {
    public static void main(String[] args) {
        // ReentrantLock 加锁
        ReentrantLock lock = new ReentrantLock();
        Condition condition = lock.newCondition();
        lock.lock();
        try {
            //业务代码
        } finally {
            lock.unlock();
        }
    }
}
